<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@page import="com.zenithsun.news.newsinfo.model.Newsinfo"%>
<%
	Newsinfo newsinfo = (Newsinfo)request.getAttribute("newsinfo");
%>

<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <meta name="viewport" content="user-scalable=no, initial-scale=1.0, maximum-scale=1.0 minimal-ui"/>
    <meta name="apple-mobile-web-app-capable" content="yes"/>
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <title>南网图讯-详情页</title>
    <link type="text/css" href="${ctx}/zenithsun/css/bootstrap/css/bootstrap.min.css" rel="stylesheet">
    <link type="text/css" href="${ctx }/zenithsun/news/pc/css/basic.css" rel="stylesheet">
    <link type="text/css" href="${ctx }/zenithsun/news/pc/css/share.css" rel="stylesheet">
    <link type="text/css" href="${ctx }/zenithsun/news/pc/css/news.css" rel="stylesheet">

    <script type="text/javascript" src="${ctx}/baseNew/plugins/jQuery/jQuery-2.2.0.min.js"></script>
</head>
<body>
<!--头部-->
<div class="mod-newsTop">
    <div class="mod-grid clearfix">
        <div class="mod-left fn-fl">
            <h1 class="mod-logo fn-fl" title="南网图讯-新闻报道"><a href="${ctx}/path/newsinfo/index" title="南网图讯"><img src="${ctx }/zenithsun/news/pc/images/inner_logo.png" alt="南网图讯"/></a></h1>
            <div class="mod-break pl20 fn-fl">
           		<a href="${ctx}/path/newsinfo/index"><i class="i-home mr5"></i>南网图片新闻网</a> <em class="i-breakTips">&gt;</em> <a href="${ctx}/path/newsinfo/channel?columnid=${newsinfo.newsColumns.id}">${newsinfo.newsColumns.name}</a> <em class="i-breakTips">&gt;</em> <a href="${ctx}/path/newsinfo/frontNewsInfo?newsId=${newsinfo.id}">正文</a>
            </div>
        </div>
    </div>
</div>

<!--内容模块-->
<div class="mainContent news-textList">
    <div class="mod-grid">

        <!--主体内容-->
        <div class="mc-body mt10 clearfix">

            <!--主体内容左边-->
            <div class="mod-left fn-fl">
                <div class="newsList-hd">
                    <h3 class="newsList-hd-title ">${newsinfo.title}</h3>
                    <div class="newsList-hd-info">
                        <div class="newsList-hd-info-item mb5 clearfix">
                            <span class="fn-fl font-c-blue newsList-item-left">南网传媒工会管理员</span>
                            <span id='readCount' class="fn-fr newsList-item-right fn-tar" >阅读：<em class="font-c-green">${newsinfo.pageViewCounter+1}</em></span>
                        </div>
                        <div class="newsList-hd-info-item mb5 clearfix">
                            <span class="fn-fl newsList-item-left">来源：<em class="font-c-blue">${newsinfo.publishGroup}</em></span>
                            <span id="publishTime" class="fn-fr  newsList-item-right fn-tar"></span>
                        </div>
                    </div>
                </div>
                <div class="newsList-bd">
                    <div class="newsList-content">
                        ${newsinfo.content}
                    </div>
                </div>
            </div>
            <!--主体内容右边-->
            <div class="mod-right newsList-right pt20 fn-fr">
                <div class="mod-news-tips mt20 pt20">
                	<div class="newGrap-grid mb5 clearfix">
                        <h4 class="newGrap mb5">新闻导语：</h4>
                        <div class="newGrap-content fts14 mb10">
                        	${newsinfo.nabstract}
                        </div>
                    </div>
                    <div class="news-author mb15">
                        栏目编辑：<em class="font-c-tip">${newsinfo.editor}</em><em class="mod-line">|</em>摄影：<em class="font-c-tip">${newsinfo.photographer}</em>
                    </div>
                    <div class="news-share mb15 clearfix">
                        <div id="shareCount" class="news-view fn-fl" "></div>
                        <div class="news-share-grid fn-fl j-share"><i class="i-share"></i>分享</div>
                    </div>
                    <div class="mod-newsTips-item">
                        <h3 class="font-c-tip mb20"><i class="i-note ml5"></i>标签：</h3>
                        <div id='keywords' class="mod-newsTips-note clearfix">
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<!--回到顶部模块-->
<div class="mod-grid fn-pr go-top">
    <a href="javascript:void(0);" title="回到顶部">回到顶部</a>
</div>
<!--底部模块-->
<div class="mod-footer">
    <div class="mod-grid clearfix">
        <div class="mod-left fn-tac fn-fl">
            <p class="mod-footer-item"><a href="#" title="关于南网图片新闻网">关于南网图片新闻网</a>|<a href="#" title="服务协议">服务协议</a>|<a href="#" title="隐私政策">隐私政策</a>|<a href="#" title="图片版权">图片版权</a></p>
            <p><a href="#">南方电网传媒有限公司</a> 版权所有　Copyright © 2015 www.csgpic.cn. All rights reserved <a href="#">粤ICP备16079034号</a> </p>
            <p>地址：广东省广州市越秀区东风东路846号　邮编：510600　联系电话：(86－020)38122925　传真：(86－020)38122993/38122992</p>
        </div>
        <div class="mod-right fn-fr">
            <a href="#" class="mod-codeBox">
                <h4>南网图片新闻客户端</h4>
                <img src="${ctx}/zenithsun/app/appQRCode.png" alt=""/>
            </a>
        </div>
    </div>
</div>

<script type="text/javascript" src="${ctx }/zenithsun/news/pc/js/ui.js"></script>
<script type="text/javascript" src="${ctx }/zenithsun/news/pc/js/share.js"></script>
<script type="text/javascript" src="${ctx }/zenithsun/news/pc/js/common.js"></script>
<script>
    $(function () {
    	//处理发布的时间格式
    	document.getElementById ("publishTime").innerHTML = dateFormatOper('${newsinfo.publishTime}');
    	//处理标签
    	showKeyWord('${newsinfo.keyword}');
    	//显示分享数目
    	//showShareCount();
    	//显示阅读数目
    	//showReadCount();
    	//更新浏览量
    	updateCounter();
    	
        //分享
        $(".j-share").socialShare({
            content: '${newsinfo.title}',
            url:window.location.href,
            title:'${newsinfo.title}'
        });
    })
    
    //处理标签 按照‘,’分隔
    function showKeyWord(keyword){
    	var keywords = splitKeyWord(keyword); //调用通用的拆分方法 common.js
    	var keyHref = "";
 	    for (i=0;i<keywords.length ;i++ )   
	    {
			var kw = encodeURI(encodeURI(keywords[i]));
 	    	var searchUrl = "${ctx}/path/newsinfo/search?value=" + kw;
 	    	keyHref += " <a href=\"" + searchUrl +"\">" + keywords[i] + "</a>";
	    } 
    	document.getElementById ("keywords").innerHTML = keyHref;
    }
    
    //转换日期格式
    function dateFormatOper(date){
    	if (date.length > 7) {
			var year = date.substr(0, 4); //年
			var month = date.substr(5, 2); //月
			var day = date.substr(8, 2); //日

			var hour = date.substr(11, 2); //时
			var min = date.substr(14, 2); //分

			var clock = year + "-";
			clock += month + "-";
			clock += day + "-";
			clock += " " + hour + ":" + min;

			return clock;
		}

		else {
			return date;
		}
    }

    //伪造分享数据
   // function showShareCount(){
   // 	var ran = parseInt('<%=newsinfo.getId().substring(newsinfo.getId().length()-4,newsinfo.getId().length())%>')*65;
   // 	document.getElementById ("shareCount").innerHTML = "<i class=\"i-eye\"></i>" + ran;
   // }

    //伪造阅读数据
  //  function showReadCount(){
   // 	var ran = parseInt('<%=newsinfo.getId().substring(newsinfo.getId().length()-4,newsinfo.getId().length())%>')*123;
   // 	document.getElementById ("readCount").innerHTML = "阅读：<em class=\"font-c-green\">"+ ran + "</em>";
   // }
  function updateCounter(){
    $.ajax({
						type : "POST",
						url : "${ctx}/path/newsinfo/modCounter",
						data : {id:"${newsinfo.id}"},
						success : function(data) {
						}
				});
   }
</script>
</body>
</html>